package com.bp.village.project.service.impl;

import java.util.List;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            import com.bp.common.utils.DateUtils;
            import javax.annotation.Resource;

import com.bp.framework.util.SecurityUtils;
import org.springframework.stereotype.Service;
import com.bp.village.project.mapper.BizVillageProjectMapper;
import com.bp.village.project.domain.BizVillageProject;
import com.bp.village.project.service.IBizVillageProjectService;

/**
 * 村级工程管理Service业务层处理
 *
 * @author shaominjie
 * @date 2021-01-26
 */
@Service
public class BizVillageProjectServiceImpl implements IBizVillageProjectService {
    @Resource
    private BizVillageProjectMapper bizVillageProjectMapper;

    /**
     * 查询村级工程管理
     *
     * @param projectId 村级工程管理ID
     * @return 村级工程管理
     */
    @Override
    public BizVillageProject selectById(Long projectId) {
        return bizVillageProjectMapper.selectById(projectId);
    }

    /**
     * 查询村级工程管理列表
     *
     * @param bizVillageProject 村级工程管理
     * @return 村级工程管理
     */
    @Override
    public List<BizVillageProject> selectList(BizVillageProject bizVillageProject) {
        return bizVillageProjectMapper.selectList(bizVillageProject);
    }

    /**
     * 新增村级工程管理
     *
     * @param bizVillageProject 村级工程管理
     * @return 结果
     */
    @Override
    public int insert(BizVillageProject bizVillageProject) {
        bizVillageProject.setCreateTime(DateUtils.getNowDate());
        bizVillageProject.setCreateBy(SecurityUtils.getUsername());
        return bizVillageProjectMapper.insert(bizVillageProject);
    }

    /**
     * 修改村级工程管理
     *
     * @param bizVillageProject 村级工程管理
     * @return 结果
     */
    @Override
    public int update(BizVillageProject bizVillageProject) {
        bizVillageProject.setUpdateTime(DateUtils.getNowDate());
        bizVillageProject.setUpdateBy(SecurityUtils.getUsername());
        return bizVillageProjectMapper.update(bizVillageProject);
    }

    /**
     * 批量删除村级工程管理
     *
     * @param projectIds 需要删除的村级工程管理ID
     * @return 结果
     */
    @Override
    public int deleteByIds(Long[] projectIds) {
        return bizVillageProjectMapper.deleteByIds(projectIds);
    }

    /**
     * 删除村级工程管理信息
     *
     * @param projectId 村级工程管理ID
     * @return 结果
     */
    @Override
    public int deleteById(Long projectId) {
        return bizVillageProjectMapper.deleteById(projectId);
    }
}
